<div id="data_page" class="in_page">
    <div class="panel panel-default">
        <div class="panel-body">
            <form class="form-inline">
                <div class="form-group">
                    <label for="exampleInputName2">问题编号</label>
                    <input value="{$username}" type="text" name="username" class="form-control"  placeholder="输入用户名" />
                    <input value="1" type="hidden" name="p" class="form-control" />
                </div>
                <button type="submit" class="btn btn-sm btn-default">搜索</button>
                <div class="btn-group">
                    <button type="reset" class="btn btn-sm btn-primary">重置</button>
                </div>
            </form>
        </div>
    </div>
    <table class="table table-bordered">
        <thead>
        <tr>
            <th>问题编号</th>
            <th>创建人</th>
            <th>标题</th>
            <th>联系人</th>
            <th>联系电话</th>
            <th>创建时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <volist name="list" id="item">
	        <tr>
	            <th scope="row">{$item.id}</th>
	            <td>{$item.name}</td>
	            <td>{$item.title}</td>
	            <td><span style="color: green">{$item.username}</span></td>
	            <td><span style="color: red">{$item.mobile}</span></td>
	            <td><span style="color: gray">{$item.create_time}</span></td>
	            <td style="width: 270px">
	                <button type="button" onclick="handleItem('{:U('/balance/add')}',{$item.id},'add')" class="btn btn-primary btn-xs">添加/扣除余额</button>
	                    <button type="button" onclick="handleItem('{:U('/balance/frozen')}',{$item.id},'frozen')" class="btn btn-success btn-xs">冻结/解冻余额</button>
	                    <button type="button"  onclick="handleItem('{:U('/balance/log')}',{$item.id},'log')"class="btn btn-xs">查看日志</button>
	            </td>
	        </tr>
        </volist>
    </table>
    {$page}
</div>

<script>
    function handleItem(_action,id,type){
        if(type=="add"){
            showIframe(_action+"?id="+id,"添加/扣除余额","750px","300px");
        }else if(type=="frozen"){
            showIframe(_action+"?id="+id,"冻结/解冻余额","750px");
        }else{
            showIframe(_action+"?id="+id,"查看日志","95%",'95%');
        }
    }
</script>